#import "CTRefuseCell.h"
@interface CTRefuseCell()
@property (nonatomic, strong) UIImageView *icon;
@property (nonatomic ,strong) UIView *contentBgView;
@end
@implementation CTRefuseCell
-(void)initialize {
    self.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:self.contentBgView];
    [self.contentBgView addSubview:self.icon];
    [self.contentBgView addSubview:self.titleLabel];
    [self.contentBgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(self.contentView);
        make.left.mas_equalTo(Ratio(36));
        make.right.mas_equalTo(self.contentView).offset(-Ratio(30));
    }];
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentBgView);
        make.left.mas_equalTo(Ratio(10));
        make.height.width.mas_equalTo(Ratio(16));
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.icon);
        make.left.mas_equalTo(self.icon.mas_right).offset(Ratio(10));
        make.right.mas_equalTo(self.contentView).offset(-Ratio(10));
    }];
}
- (void)setIsSelect:(BOOL)isSelect {
    _isSelect = isSelect;
    _icon.image = isSelect ? [UIImage imageNamed:@"login_sel"] : [UIImage imageNamed:@"login_unsel"];
}
- (UIImageView *)icon {
    if (!_icon) {
        _icon = [[UIImageView alloc] init];
        _icon.frame = CGRectMake(Ratio(42), Ratio(10), Ratio(20.0f), Ratio(20.0f));
        _icon.contentMode = UIViewContentModeScaleToFill;
        _icon.userInteractionEnabled = NO;
        _icon.image = [UIImage imageNamed:@"login_unsel"];
    }
    return _icon;
}
- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.numberOfLines = 1;
        _titleLabel.font = kFontRatio(12);
        _titleLabel.textColor = [UIColor color999];
        _titleLabel.text = @"";
    }
    return _titleLabel;
}
- (UIView *)contentBgView
{
    if (!_contentBgView) {
        _contentBgView = [[UIView alloc] initWithFrame:CGRectZero];
        _contentBgView.backgroundColor = [UIColor colorWithHexString:@"#F4F6FB"];
    }
    return _contentBgView;
}
@end
